//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Web.UI;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.ControlPanel.UI;

namespace CommunityServer.ControlPanel.Controls
{
	/// <summary>
	/// Summary description for CurrentWeblog.
	/// </summary>
	public class CurrentWeblog : Control
	{
		public CurrentWeblog()
		{
		
		}

        protected override void Render(HtmlTextWriter writer)
        {
        	BaseBlogPage BlogPage = this.Page as BaseBlogPage;
        	Weblog w = BlogPage.CurrentWeblog;
            if(w != null)
            {
            	HyperLink link = new HyperLink();
                link.Text = w.Name;
                link.NavigateUrl = BlogUrls.Instance().HomePage(w.ApplicationKey);
                link.RenderControl(writer);
                
            }
            else
            {
                writer.Write("Unknown");
            }
        }

	}
}
